<div class="right_side_operate_area">
	<?php  
		$user=$session->read('User');
		$companyid=$session->read("companyid");
		$userid=base64_encode($user["id"]);
		$cid=base64_encode($companyid);
		$isflag=true;
		if($showpage==1) {
			if(isset($paging)){ echo $this->renderElement('pagination',$paging);} 
		}
	?>
	<?php 
    	if(classregistry::init('User')->personAuthority($user)){
    		echo '<div class="right item_add_btn">';
			echo $html->link(__("Add",true),"/companys/editfinacerelease/");
			echo '</div>';
		}else{
			echo '<div class="right enableaction">';
			echo "<a>添加</a>";
			echo '</div>';
		}
	?>
	<!--<div class="right back_btn">
			<?php 
//            	$urlpath=$accp->path."/loginsys?id=".$userid."&action=".base64_encode("finacedemand").'&cid='.$cid;
//            	echo '<a target="_blank" href="'.$urlpath.'">预览</a>';
            ?>
	</div>-->
	<div class="right_side_title left">
		<h2>
		<?php 
		$companyname=$session->read("companyname");
		echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
		?>
		</h2>
		<div class="clear"></div>
	</div>
    <div class="clear"></div>
</div>

<div class="right_side_scollbar">
    <div class="detail_info_panel">
        <div class="items_list">
        	<table>
        		<tr >
        			<th>标题</th>
        			<th>金额（万元）</th>
        			<th>需求</th>
        			<th>发布日期</th>
        			<th>操作</th>
        		</tr>
        		
        		<?php
		        	    	foreach($finacereleases as $finacerelease)
		        	    	{
		        	    		$id = $finacerelease["CompFinacerelease"]["id"];
			        	    	echo "<tr class='per_list'>";
			        			$title = $finacerelease["CompFinacerelease"]["title"];
			        			echo "<td>".$html->link($str->sub_len($title,10),"/companys/showfinacerelease/".$id,array("title"=>$title),null)."</td>";
			        			$amount = $finacerelease["CompFinacerelease"]["amount"];
			        			echo "<td>".$amount."</td>";
			        			$requirement = $finacerelease["CompFinacerelease"]["requirement"];
			        			echo "<td title = '".$requirement."'>".$str->sub_len($requirement,15)."</td>";
			        			$date = date("Y-m-d",strtotime($finacerelease["CompFinacerelease"]["created"]));
			        			echo "<td>".$date."</td>";
			        			
			        			echo "<td>";
			        			$company=classregistry::init('Company')->findById($companyid);
								if(classregistry::init('User')->personAuthority($user)&&classregistry::init('Company')->personAuthority($company))
								{
									echo $html->link(__("Edit",true),"/companys/editfinacerelease/".$id,null,null);
									echo $html->link(__("Delete",true),"/companys/delfinacerelease/".$id,array("onclick"=>"return doaction(this)"));
								}else
								{
									echo "<span class='enableaction'>编辑</span>";
									echo "<span class='enableaction'>删除</span>";
								}
								echo "</td>";
								
								echo "</tr>";
		        			}
        		?>
        		
        	</table>
        </div>
    </div>
</div>
 <?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>